1. Field of the Invention
The present invention generally relates to a method and apparatus for constructing undo and redo activity logs in a distributed data access environment and, more particularly, to a method and apparatus for merging undo and redo activity logs to a set of data items modified by at least two users in a distributed data access environment and allowing any of the users to gain access to the merged activity logs in order to undo and redo the activities across prior locks.
2. Background Description
Database technology and file management systems are commonly used for accessing shared sets of data items between several users. Database systems are typically fine grained (e.g., allowing access to well defined data structures or fields) and highly scalable (e.g., allowing a number of users to access the system concurrently). Database systems also usually provide extensive capabilities to query data values across multiple data entries, and even across groupings of data.
In contrast to database systems, file management systems do not provide very good granularity. That is, these systems typically allow access to only whole files at a time. Also, file management systems provide query capabilities to directory content, thus providing poor functionality in comparison to database systems.
However, both database systems and file management systems provide (i) data locking and access, (ii) data changing and (iii) committing changes with access relinquishment. In other words, both systems. provide a means to access data and lock data in order to make and commit changes to the data. "Locking" the data refers to read-write capabilities over the data; whereas "unlocking" the data refers to the relinquishment of the read-write access of the data.
After locking the data, the user may change the data through a number of actions. With proper support from the data management systems, these actions may also be undone with the data restored to its prior state. The manner in which this is accomplished is well known, and typically involves, per action, saving the prior state of the data that was changed. This is referred as to the momento of the action. These activities, comprising actions along with their corresponding mementos, may be incorporated into a user activity log consisting of a set of actions undertaken by the user between the time the data is accessed until the data is committed and access to the data is relinquished. The user's activity log may be accessed and re-accessed by that particular user (i.e., the user who created that specific action log) in order to undo changes or redo undone changes to the data items.
Database management typically account for only a subset of this information. At most, a data management system journals instances of changes, indicating that the data has changed, who changed it, and when it was changed. Data restorations are generally made through backup systems which account for a snapshot of the data at some point in time. The recording of data changes along the mementos is typically done at an application level, outside of the data management system.
Even when a data management journals data changes, including mementos, simple access to this data is insufficient and problematic. Data is often changed in relationship to each other. For example, the creation of a new bank account is accompanied with its insertion into the list of bank records. Undo/redo activities is often done in this context of several data items, and undoing/redoing data on a single item could ultimately place all of the data out of sync.
Situations arise which require more processing to make this data useful to a user. For example, a first user gains access to a first set of data items, which although separately accessed, form a related set of data items where changes to any one item are seldom made without locking all those data items. The first set of data items is now locked and the user may then make any desired changes to the accessed data. After the changes are made the user then relinquishes access to the data items. During the time the user has access and changes the data, the system journals the undo and redo activities for this user. A subsequent user may then gain access to the relinquished data and lock that set of data items with the intention of making further changes. However, the subsequent user does not have the additional capability of undoing and redoing undone changes of the first user. In essence, the activities of the first user are incorporated in the first user's activity log and may only be accessed and re-accessed by that particular user (i.e., the user who created that specific action log) in order to undo changes or redo undone changes to the data items. Accordingly, any subsequent user that accesses the same data item may make subsequent changes to the data item, but a new activity log consisting of a new set of activities undertaken by the subsequent user will then be created.
For example, a first user gains access to a first set of data items. The first set of data items are now locked. The user then makes any desired changes to the accessed data, and thereafter relinquishes access to the data. During the time the user has access and makes changes to the data, the system creates an undo and redo activity log for that user. A subsequent user may then gain access to the same set of data items and lock that set of data items. The subsequent user may also make any appropriate changes to the data items, at which time the system will create another undo and redo activity log for that subsequent user. However, at this point two separate undo and redo activity logs are created and stored within the database, and access to these separate activity logs may only be accessed individually. Thus, for example, the subsequent user cannot recreate (e.g., redo or undo any redone actions) any activities that were performed by the first user, and vice versa, unless the user gains access to the separate activity log.
Because the activity logs are not merged together, restoration of the data items after several changes amongst several users is very difficult to accomplish. That is, data cannot be incrementally restored to prior saved states by previous users across locks without accessing all the user's activity logs and recreating the data in the exact order that it was changed.
The creation of activity logs incorporating undo/redo activities of more than two users becomes even more complicated. In these instances many of the changes to previous logs may lose definition and the changes to the set of data items made by a previous user may not be undone or redone by any subsequent user.